 import layoutHeaderAside from '@/layout/header-aside'

 // 由于懒加载页面太多的话会造成webpack热更新太慢，所以开发环境不使用懒加载，只有生产环境使用懒加载
 const _import = require('@/libs/util.import.' + process.env.NODE_ENV)

 /**
  * 在主框架内显示
  */
 const frameIn = [{
     path: '/',
     redirect: { name: 'index' },
     component: layoutHeaderAside,
     children: [
         // 首页
         {
             path: '/pageIndex',
             name: 'pageIndex',
             meta: {
                 auth: true,
                 title: '首页'
             },
             component: () =>
                 import ('@/pages/index/index')

         },
         {
             path: 'index',
             name: 'index',
             meta: {
                 auth: true
             },
             component: _import('system/index')
                 //  beforeEnter() { location.href = 'https://datav.aliyuncs.com/share/708b74dfbf1379ac1c9470c0ff6e6bc9' }
         },
         {
             path: '/audit',
             name: 'audit',
             meta: {
                 auth: true,
                 title: '申诉审核'
             },
             component: () =>
                 import ('@/pages/audit/audit')
         },
         {
             path: '/user',
             name: 'user',
             meta: {
                 auth: true,
                 title: '用户管理'
             },
             component: () =>
                 import ('@/pages/user/userList')
         },
         {
             path: '/Violations',
             name: 'Violations',
             meta: {
                 auth: true,
                 title: '违章记录'
             },
             component: () =>
                 import ('@/pages/Violations/Violations')
         },
         {
             path: '/licensePlate',
             name: 'licensePlate',
             meta: {
                 auth: true,
                 title: '车牌车主'
             },
             component: () =>
                 import ('@/pages/licensePlate/licensePlate')
         },
         {
             path: '/licensePlateIndex',
             name: 'licensePlateIndex',
             meta: {
                 auth: true,
                 title: '具体信息'
             },
             component: () =>
                 import ('@/pages/licensePlate/index')
         },

         {
             path: '/video',
             name: 'video',
             meta: {
                 auth: true,
                 title: '视频上传'
             },
             component: () =>
                 import ('@/pages/upload/video')
         },
         {
             path: '/monitoring',
             name: 'monitoring',
             meta: {
                 auth: true,
                 title: '监控上传'
             },
             component: () =>
                 import ('@/pages/upload/monitoring')
         },

         // 演示页面

         // 系统 前端日志
         {
             path: 'log',
             name: 'log',
             meta: {
                 title: '前端日志',
                 auth: true
             },
             component: _import('system/log')
         },
         // 刷新页面 必须保留
         {
             path: 'refresh',
             name: 'refresh',
             hidden: true,
             component: _import('system/function/refresh')
         },
         // 页面重定向 必须保留
         {
             path: 'redirect/:route*',
             name: 'redirect',
             hidden: true,
             component: _import('system/function/redirect')
         }

     ]
 }]

 /**
  * 在主框架之外显示
  */
 const frameOut = [
     // 登录
     {
         path: '/login',
         name: 'login',
         component: _import('system/login')
     },
     {
         path: '/sign',
         name: 'sign',
         component: _import('system/sign')
     }
 ]

 /**
  * 错误页面
  */
 const errorPage = [{
     path: '*',
     name: '404',
     component: _import('system/error/404')
 }]

 // 导出需要显示菜单的
 export const frameInRoutes = frameIn

 // 重新组织后导出
 export default [
     ...frameIn,
     ...frameOut,
     ...errorPage
 ]